package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import com.leyou.item.entity.CategoryBrand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CategoryBrandMapper extends BaseMapper<CategoryBrand> {

    @Select("select tb.id,tb.name,tb.image,tb.letter " +
            "from tb_category_brand tcb inner join tb_brand tb " +
            "on tcb.brand_id = tb.id " +
            "where tcb.category_id = #{cid}")
    List<Brand> queryBrandByCategoryId(@Param("cid") Long cid);

}
